package com.jymj.entity.gantt;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;

/**
 * Created by ljj on 2019/3/8.
 */
public class MoveCost implements Comparable, Serializable {

    private Integer costId;
    private Integer pjid;
    //序号
    private String count;
    //项目
    private String project;
    //工程量万m2
    private BigDecimal quantitie;
    //工程量 单位
    private String quaunit;
    //计费单价 元/m2
    private BigDecimal bilprice;
    //单价 单位
    private String unit;
    //总计（万元）
    private BigDecimal sumcost;
    //备注
    private String text;
    //上级id
    private Integer parentid;
    private Integer keyId;
    private List<MoveCost> children;
    //rt_invest  id
    private Long rtInvestId;
    private BigDecimal zf1;//支付一期 *
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date zf1Date;
    private BigDecimal zf2;//支付二期 *
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date zf2Date;
    private BigDecimal zf3;//支付三期 *
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date zf3Date;
    private BigDecimal zf4;//支付四期 *
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date zf4Date;
    private BigDecimal zf5;//支付5期 *
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date zf5Date;
    private BigDecimal zf6;//支付6期 *
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date zf6Date;
    private Integer movecostId;
    private Integer type;

    public Long getRtInvestId() {
        return rtInvestId;
    }

    public void setRtInvestId(Long rtInvestId) {
        this.rtInvestId = rtInvestId;
    }

    public BigDecimal getZf1() {
        return zf1;
    }

    public void setZf1(BigDecimal zf1) {
        this.zf1 = zf1;
    }

    public Date getZf1Date() {
        return zf1Date;
    }

    public void setZf1Date(Date zf1Date) {
        this.zf1Date = zf1Date;
    }

    public BigDecimal getZf2() {
        return zf2;
    }

    public void setZf2(BigDecimal zf2) {
        this.zf2 = zf2;
    }

    public Date getZf2Date() {
        return zf2Date;
    }

    public void setZf2Date(Date zf2Date) {
        this.zf2Date = zf2Date;
    }

    public BigDecimal getZf3() {
        return zf3;
    }

    public void setZf3(BigDecimal zf3) {
        this.zf3 = zf3;
    }

    public Date getZf3Date() {
        return zf3Date;
    }

    public void setZf3Date(Date zf3Date) {
        this.zf3Date = zf3Date;
    }

    public BigDecimal getZf4() {
        return zf4;
    }

    public void setZf4(BigDecimal zf4) {
        this.zf4 = zf4;
    }

    public Date getZf4Date() {
        return zf4Date;
    }

    public void setZf4Date(Date zf4Date) {
        this.zf4Date = zf4Date;
    }

    public Integer getMovecostId() {
        return movecostId;
    }

    public void setMovecostId(Integer movecostId) {
        this.movecostId = movecostId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getParentid() {
        return parentid;
    }

    public void setParentid(Integer parentid) {
        this.parentid = parentid;
    }

    public List<MoveCost> getChildren() {
        return children;
    }

    public void setChildren(List<MoveCost> children) {
        this.children = children;
    }

    public Integer getCostId() {
        return costId;
    }

    public void setCostId(Integer costId) {
        this.costId = costId;
    }

    public Integer getPjid() {
        return pjid;
    }

    public void setPjid(Integer pjid) {
        this.pjid = pjid;
    }

    public String getCount() {
        return count;
    }

    public void setCount(String count) {
        this.count = count;
    }

    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public BigDecimal getQuantitie() {
        return quantitie == null ? null : quantitie.setScale(2, RoundingMode.HALF_UP);
    }

    public void setQuantitie(BigDecimal quantitie) {
        this.quantitie = quantitie;
    }

    public BigDecimal getBilprice() {
        return bilprice;
    }

    public void setBilprice(BigDecimal bilprice) {
        this.bilprice = bilprice;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public BigDecimal getSumcost() {
        return sumcost == null ? null : sumcost.setScale(1, RoundingMode.HALF_UP);
    }

    public void setSumcost(BigDecimal sumcost) {
        this.sumcost = sumcost;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public Integer getKeyId() {
        return keyId;
    }

    public void setKeyId(Integer keyId) {
        this.keyId = keyId;
    }

    public String getQuaunit() {
        return quaunit;
    }

    public void setQuaunit(String quaunit) {
        this.quaunit = quaunit;
    }

    @Override
    public int compareTo(Object o) {
        MoveCost m = (MoveCost) o;
        int c = m.getCostId() == null ? 0 : m.getCostId();
        return this.costId.compareTo(c);
    }

    public BigDecimal getZf5() {
        return zf5;
    }

    public void setZf5(BigDecimal zf5) {
        this.zf5 = zf5;
    }

    public Date getZf5Date() {
        return zf5Date;
    }

    public void setZf5Date(Date zf5Date) {
        this.zf5Date = zf5Date;
    }

    public BigDecimal getZf6() {
        return zf6;
    }

    public void setZf6(BigDecimal zf6) {
        this.zf6 = zf6;
    }

    public Date getZf6Date() {
        return zf6Date;
    }

    public void setZf6Date(Date zf6Date) {
        this.zf6Date = zf6Date;
    }
}
